/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cbs.management.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Khuong Dao
 */
@Entity
@Table(name = "ap_param")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ApParam.findAll", query = "SELECT a FROM ApParam a"),
    @NamedQuery(name = "ApParam.findById", query = "SELECT a FROM ApParam a WHERE a.id = :id"),
    @NamedQuery(name = "ApParam.findByType", query = "SELECT a FROM ApParam a WHERE a.type = :type"),
    @NamedQuery(name = "ApParam.findByValue", query = "SELECT a FROM ApParam a WHERE a.value = :value"),
    @NamedQuery(name = "ApParam.findByCode", query = "SELECT a FROM ApParam a WHERE a.code = :code"),
    @NamedQuery(name = "ApParam.findByStatus", query = "SELECT a FROM ApParam a WHERE a.status = :status")})
public class ApParam implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "type")
    private String type;
    @Basic(optional = false)
    @Column(name = "value")
    private String value;
    @Basic(optional = false)
    @Column(name = "code")
    private String code;
    @Basic(optional = false)
    @Column(name = "status")
    private int status;

    public ApParam() {
    }

    public ApParam(Integer id) {
        this.id = id;
    }

    public ApParam(Integer id, String type, String value, String code, int status) {
        this.id = id;
        this.type = type;
        this.value = value;
        this.code = code;
        this.status = status;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ApParam)) {
            return false;
        }
        ApParam other = (ApParam) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.cbs.management.model.ApParam[ id=" + id + " ]";
    }
    
}
